Copyright: Text Copyright 1995 by H. Eric Theis, Jr.


The navButton Custom Control

Properties	Events	Copyright	Warranties

The navButton Custom Control is a bound pushbutton control.  Unlike most bound controls, a navButton does not display any data.  Instead, it provides an alternative to the bound controls own buttons for controlling the underlying recordset.

The navButton control exists because the Data Control does not intelligently disable its controlling arrows.  As anyone who has ever used one can attest, there is no way to visually identify which buttons are valid and whether or not the recordset is currently at the beginning or the end of the file.

The navButton control can take on a Style of First, Previous, Next, or Last.  Each style has its own graphical representation, extremely similar to the corresponding component of the Data Control.

The actual action of the navButton mimics the action of the corresponding Data Control button as well, with additional events, the Before and After events, involved.

The navButton also has a property called AutoDisable, which, when set (it is set by default), causes the control to disable itself when no record exists in the dataset in the direction the arrow is pointing and enable itself when such as record exists.

Typically, these controls are used to replace the buttons supplied on the Data Control.  The Data Control still must be used, but its Visible property is set to FALSE so that it is not displayed to the user.

The database engine underlying the Data Control does not matter except that it must support bookmarks.

Note: The navButton control requires Visual Basic 3.0.  Since the Data Control is necessary for its operation, it will not function in other environments.  It does not require the Professional Edition, however.


A bound control is a control that is linked to a Data Control.  The Data Control accesses a database and passes data and instructions to the controls that are bound to it.


A recordset is an object that represents a subset of a database.  A Data Control has a recordset component.


  About	* HelpContextID	  Style

  AutoDisable	* Hwnd	* TabIndex

* DataSource	* Index	* TabStop

* DragIcon	* Left	* Tag

* DragMode	* MousePointer	* Top

* Enabled	* Name	* Visible

* Height	* Parent	* Width

* Indicates a standard property.
  See Visual Basic documentation for meaning and use.


  After	* GotFocus	* KeyUp

  Before	* KeyDown	* LostFocus

* DragDrop	* KeyPress	* MouseMove

* DragOver

* Indicates a standard event.
  See Visual Basic documentation for meaning and use.


Copyright 1995 by H. Eric Theis, Jr.

This product is supplied as shareware, not freeware. License is granted for evaluation use only.  At the end of your evaluation period, you are expected to either destroy all copies of this product or to send $5.00 per copy to the copyright owner. For information where to send your $5, for comments, or for source code availability, please contact the author on Compuserve at 76270, 1533.

Failing to send your $5 will cause two things:

1) Your conscience will both you forever; and/or

2) I will be unable to justify my time to my wife to produce new or better stuff.

ITS JUST 5 BUCKS!


The About Property

The navButton Custom Control

This property is only available at design time.  From the properties window, select the About property. An elipsis (...) will appear at the right side of the drop down box.  Pressing the elipsis will cause a dialog box to be displayed which will show the version number of the navButton control currently installed.


The AutoDisable Property

The navButton Custom Control

Description	If TRUE, then this property will cause the custom control to change its own Enabled property depending on whether a record exists in the underlying recordset in the direction of the controls arrow (see the Style property).

This property is TRUE by default.

Remarks	An example illustrates this property better.  If the Style property is set to NEXT and this property is TRUE, when the current record in the Data Controls recordset is the last record, then the navButton will disable itself, otherwise the navButton will be enabled.

Note that this property functions on the navButton regardless of the method used to get to the current record.

Data Type	Boolean


The Style Property

The navButton Custom Control

Description	Controls the representation and the action of the control.

Remarks	This property can assume the following values:

Value	Meaning	Bitmap

0	First

1	Previous

2	Next

3	Last

The control will assume the visual representation of the selected style.

When the button is pressed, it will cause the proper action to take place for the associated Data Control, invoking the Before event before actually taking the action and the After event when the action has completed.

The default value for this property changes.  The first such control created will default to 0 (FIRST), the second to 1 (PREVIOUS), and so on.  This is so that controls created consecutively will have the proper styles.

Data Type	Integer


The After Event

The navButton Custom Control

Arguments	none

Description	This event is invoked only when a navButton has been clicked (this event, with the Before event, replaces the buttons Click event).  It is invoked immediately after the action is taken.

Remarks	Typically, this event is used to update non-bound controls after the current record has changed.


The Before Event

The navButton Custom Control

Arguments	Cancel As Integer

Description	This event is invoked only when a navButton has been clicked (this event, with the After event, replaces the buttons Click event).  It is invoked immediately before the action is taken.

Remarks	Typically, this event is used to test if data must be saved before the navigation action is actually taken.  If the Cancel argument is TRUE when the event code returns, the action will not be taken.


There are no warranties on this product.

The useability, capabilities, and qualities, for any
purpose, of this product is in no way guaranteed or
warranteed.  The copyright owner, while maintaining
his rights under copyright laws, is not liable in any
way for any damages or losses due to the use of
this product.

In states which forbid this disclaimer, the liability of
the owner of the copyright holder shall not exceed
the purchase price of this product.